﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.Odbc;
using System.Configuration;
using System.IO;



using System.Diagnostics;


namespace AvisoSuporte
{
    public class Remedy
    {
        private string remedyUserName = ConfigurationSettings.AppSettings["remedyUserName"].ToString();
        private string remedyPassword = ConfigurationSettings.AppSettings["remedyPassword"].ToString();
        private string proxyServer = ConfigurationSettings.AppSettings["proxyServer"].ToString();

        public AvisoSuporte.remedyWS.GetListOutputMapGetListValues[] getIncidentsWS(string Classification)
        {
            AvisoSuporte.remedyWS.ITPAM_HPD_HelpDesk_WSService obj = new AvisoSuporte.remedyWS.ITPAM_HPD_HelpDesk_WSService();
            AvisoSuporte.remedyWS.AuthenticationInfo AuthenticationInfoValue = new AvisoSuporte.remedyWS.AuthenticationInfo();

            AuthenticationInfoValue.userName = remedyUserName;
            AuthenticationInfoValue.password = remedyPassword;
            obj.AuthenticationInfoValue = AuthenticationInfoValue;
            obj.Timeout = 999999999;

            System.Net.WebProxy proxy = new System.Net.WebProxy(proxyServer, 80);
            System.Net.NetworkCredential cred = new System.Net.NetworkCredential();
            cred.Domain = "corporate";
            cred.UserName = AuthenticationInfoValue.userName;
            cred.Password = AuthenticationInfoValue.password;
            proxy.Credentials = cred;
            obj.Proxy = proxy;

            AvisoSuporte.remedyWS.GetListOutputMapGetListValues[] dsresult;
            dsresult = obj.HelpDesk_GetList(Classification, "0", string.Empty);
            //dsresult = obj.HelpDesk_GetList("", "0", "10");


            return dsresult;

        }
      
    }

}









